#   -*- mode: makefile; coding: utf-8; -*-
#
#   Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
#   This file is part of Intromit.
#
#   Intromit is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   Intromit is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with Intromit.  If not, see <http://www.gnu.org/licenses/>.

LIBTOOL = @LIBTOOL@

nobase_lib_LTLIBRARIES = intromit/generators/gendata.la

intromit_generators_gendata_la_LDFLAGS= @LIBDW_LDFLAGS@ -lbfd -module
intromit_generators_gendata_la_LIBADD = \
	../../util/libutil.la \
	../../intromit/elf.lo ../../intromit/dwarf.lo \
	../../intromit/metadata.lo ../../intromit/config.lo \
	../../intromit/source.lo
intromit_generators_gendata_la_SOURCES= \
	gendata.cc gendata.hh gendata_common.cc gendata_common.hh

INCLUDES = -I../../util -I../../intromit

EXTRA_DIST =

MAINTAINERCLEANFILES =  Makefile.in 

# change security context of run-time dynamic libraries just in case SELinux are activated
all-local:
	find intromit/generators/ -iname '*.so' -exec chcon -t texrel_shlib_t {} \; >& /dev/null

install-exec-hook:
	find $(prefix)/lib/intromit/generators/ -iname '*.so' -exec chcon -t texrel_shlib_t {} \; >& /dev/null

clean-local:
	rm -rf *~ *.da intromit

install-fast:
	mkdir -p $(prefix)/lib/intromit/generators
	for f in $(patsubst lib%.la,%,$(lib_LTLIBRARIES));  do \
		rm -f $(prefix)/lib/intromit/generators/$$f.so; \
		ln -sfn $$(pwd)/.libs/lib$$f.so $(prefix)/lib/intromit/generators/$$f.so; \
		ln -fs ./lib$$f.so $(prefix)/lib/intromit/generators/$$f.so; \
	done
